using System;
using MediaPortal.GUI.Library;
using System.Text.RegularExpressions;
using System.IO;
using System.Text;
using MediaPortal.Player;
using System.Collections.Generic;
//using MediaPortal.Utils.Services;
using MediaPortal.GUI.View ;
using MediaPortal.Dialogs;
using MediaPortal.Util;
using System.Xml;
using System.Xml.XPath;
using System.ComponentModel;
using System.Threading;



namespace OnlineVideos
{
    public class DownloadedVideoUtil:SiteUtilBase 
    {
       public override string getSiteId()
		{
			return "99";
		}
               
       protected override String getUrl(String fsId)
        {

            return fsId;
        }
		public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl)
		{
		    List<GUIOnlineVideos.VideoInfo>loVideoInfoList = new List<GUIOnlineVideos.VideoInfo>();
            string[]loVideoList = Directory.GetFiles(fsUrl);
            

            GUIOnlineVideos.VideoInfo loVideoInfo;
            foreach (String lsVideo in loVideoList)
            {
            	if(isPossibleVideo(lsVideo)){
                	loVideoInfo = new GUIOnlineVideos.VideoInfo();
                	loVideoInfo.VideoUrl = lsVideo;
                
                	loVideoInfo.Title  = Utils.GetFilename(lsVideo);
                	loVideoInfoList.Add(loVideoInfo);
            	}
            }
            return loVideoInfoList;
        }
            
    }
}
